Don't display the option to change update channels when server has valid subscription.
authorCamila Ayres <hello@camilasan.com>
Mon, 17 Feb 2025 16:20:57 +0000 (17:20 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 18 Feb 2025 09:48:42 +0000 (09:48 +0000)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/generalsettings.cpp

index d6aec9821f9888a0cbfbd3fea0c91ed8bc970b6d..d4a0aeaa4d4a0205ed64a6d72f4dc7096b57d5e6 100644 (file)
@@ -326,6 +326,12 @@ void GeneralSettings::loadMiscSettings()
 #if defined(BUILD_UPDATER)
 void GeneralSettings::loadUpdateChannelsList() {
     ConfigFile cfgFile;
+    if (cfgFile.serverHasValidSubscription()) {
+        _ui->updateChannel->hide();
+        _ui->updateChannelLabel->hide();
+        return;
+    }
+
     const auto validUpdateChannels = cfgFile.validUpdateChannels();
     if (_currentUpdateChannelList.isEmpty() || _currentUpdateChannelList != validUpdateChannels){
         _currentUpdateChannelList = validUpdateChannels;
@@ -333,7 +339,6 @@ void GeneralSettings::loadUpdateChannelsList() {
         _ui->updateChannel->addItems(_currentUpdateChannelList);
         const auto currentUpdateChannelIndex = _currentUpdateChannelList.indexOf(cfgFile.currentUpdateChannel());
         _ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex != -1 ? currentUpdateChannelIndex : 0);
-        _ui->updateChannel->setDisabled(cfgFile.serverHasValidSubscription());
         connect(_ui->updateChannel, &QComboBox::currentTextChanged, this, &GeneralSettings::slotUpdateChannelChanged);
     }
 }